package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.List;

import lombok.Data;

/**
 * 客户订单材料表
 *
 * @TableName pro_client_order_item
 */
@TableName(value = "pro_client_order_item")
@Data
public class ProClientOrderItem implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer orderItemId;

    /**
     * 客户订单表id
     */
    private Integer clientOrderId;

    /**
     * 客户订单表编码
     */
    private String clientOrderCode;

    /**
     * 工单ID
     */
    private Integer workorderId;

    /**
     * 工单编码
     */
    private String workorderCode;

    /**
     * 工单名称
     */
    private String workorderName;

    /**
     * 物料产品ID
     */
    private Integer itemId;

    /**
     * 产品物料编码
     */
    private String itemCode;

    /**
     * 产品物料名称
     */
    private String itemName;

    /**
     * 规格型号
     */
    private String specification;

    /**
     * 单位
     */
    private String unitOfMeasure;

    /**
     * 物料使用数量
     */
    private Integer quantity;

    /**
     * 层级，字典表：mes_item_level
     */
    private String level;

    /**
     * 备注
     */
    private String remark;

    /**
     * 单位名称
     */
    private String unitName;

    /**
     * 预留字段3
     */
    private Integer attr3;

    /**
     * 预留字段4
     */
    private Integer attr4;

    @TableField(exist = false)
    private Inventory inventory;

    @TableField(exist = false)
    private Units units;

    @TableField(exist = false)
    private Warehouse warehouse;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProClientOrderItem other = (ProClientOrderItem) that;
        return (this.getOrderItemId() == null ? other.getOrderItemId() == null : this.getOrderItemId().equals(other.getOrderItemId()))
                && (this.getClientOrderId() == null ? other.getClientOrderId() == null : this.getClientOrderId().equals(other.getClientOrderId()))
                && (this.getClientOrderCode() == null ? other.getClientOrderCode() == null : this.getClientOrderCode().equals(other.getClientOrderCode()))
                && (this.getWorkorderId() == null ? other.getWorkorderId() == null : this.getWorkorderId().equals(other.getWorkorderId()))
                && (this.getWorkorderCode() == null ? other.getWorkorderCode() == null : this.getWorkorderCode().equals(other.getWorkorderCode()))
                && (this.getWorkorderName() == null ? other.getWorkorderName() == null : this.getWorkorderName().equals(other.getWorkorderName()))
                && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
                && (this.getItemCode() == null ? other.getItemCode() == null : this.getItemCode().equals(other.getItemCode()))
                && (this.getItemName() == null ? other.getItemName() == null : this.getItemName().equals(other.getItemName()))
                && (this.getSpecification() == null ? other.getSpecification() == null : this.getSpecification().equals(other.getSpecification()))
                && (this.getUnitOfMeasure() == null ? other.getUnitOfMeasure() == null : this.getUnitOfMeasure().equals(other.getUnitOfMeasure()))
                && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
                && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
                && (this.getUnitName() == null ? other.getUnitName() == null : this.getUnitName().equals(other.getUnitName()))
                && (this.getAttr3() == null ? other.getAttr3() == null : this.getAttr3().equals(other.getAttr3()))
                && (this.getAttr4() == null ? other.getAttr4() == null : this.getAttr4().equals(other.getAttr4()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderItemId() == null) ? 0 : getOrderItemId().hashCode());
        result = prime * result + ((getClientOrderId() == null) ? 0 : getClientOrderId().hashCode());
        result = prime * result + ((getClientOrderCode() == null) ? 0 : getClientOrderCode().hashCode());
        result = prime * result + ((getWorkorderId() == null) ? 0 : getWorkorderId().hashCode());
        result = prime * result + ((getWorkorderCode() == null) ? 0 : getWorkorderCode().hashCode());
        result = prime * result + ((getWorkorderName() == null) ? 0 : getWorkorderName().hashCode());
        result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
        result = prime * result + ((getItemCode() == null) ? 0 : getItemCode().hashCode());
        result = prime * result + ((getItemName() == null) ? 0 : getItemName().hashCode());
        result = prime * result + ((getSpecification() == null) ? 0 : getSpecification().hashCode());
        result = prime * result + ((getUnitOfMeasure() == null) ? 0 : getUnitOfMeasure().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getUnitName() == null) ? 0 : getUnitName().hashCode());
        result = prime * result + ((getAttr3() == null) ? 0 : getAttr3().hashCode());
        result = prime * result + ((getAttr4() == null) ? 0 : getAttr4().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderItemId=").append(orderItemId);
        sb.append(", clientOrderId=").append(clientOrderId);
        sb.append(", clientOrderCode=").append(clientOrderCode);
        sb.append(", workorderId=").append(workorderId);
        sb.append(", workorderCode=").append(workorderCode);
        sb.append(", workorderName=").append(workorderName);
        sb.append(", itemId=").append(itemId);
        sb.append(", itemCode=").append(itemCode);
        sb.append(", itemName=").append(itemName);
        sb.append(", specification=").append(specification);
        sb.append(", unitOfMeasure=").append(unitOfMeasure);
        sb.append(", quantity=").append(quantity);
        sb.append(", level=").append(level);
        sb.append(", remark=").append(remark);
        sb.append(", unitName=").append(unitName);
        sb.append(", attr3=").append(attr3);
        sb.append(", attr4=").append(attr4);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}